add_subdirectory(utils)

# Create list of all headers
set(dis6_hdr
  AcknowledgePdu.h
  AcknowledgeReliablePdu.h
  AcousticBeamData.h
  AcousticBeamFundamentalParameter.h
  AcousticEmitter.h
  AcousticEmitterSystemData.h
  AcousticEmitterSystem.h
  ActionRequestPdu.h
  ActionRequestReliablePdu.h
  ActionResponsePdu.h
  ActionResponseReliablePdu.h
  AggregateID.h
  AggregateMarking.h
  AggregateStatePdu.h
  AggregateType.h
  AngularVelocityVector.h
  AntennaLocation.h
  ApaData.h
  ArealObjectStatePdu.h
  ArticulationParameter.h
  BeamAntennaPattern.h
  BeamData.h
  BurstDescriptor.h
  ClockTime.h
  CollisionElasticPdu.h
  CollisionPdu.h
  CommentPdu.h
  CommentReliablePdu.h
  CreateEntityPdu.h
  CreateEntityReliablePdu.h
  DataPdu.h
  DataQueryPdu.h
  DataQueryReliablePdu.h
  DataReliablePdu.h
  DeadReckoningParameter.h
  DesignatorPdu.h
  DetonationPdu.h
  DistributedEmissionsFamilyPdu.h
  EightByteChunk.h
  ElectromagneticEmissionBeamData.h
  ElectromagneticEmissionsPdu.h
  ElectromagneticEmissionSystemData.h
  EmitterSystem.h
  EntityID.h
  EntityInformationFamilyPdu.h
  EntityManagementFamilyPdu.h
  EntityStatePdu.h
  EntityStateUpdatePdu.h
  EntityType.h
  EnvironmentalProcessPdu.h
  Environment.h
  EventID.h
  EventReportPdu.h
  EventReportReliablePdu.h
  FastEntityStatePdu.h
  FirePdu.h
  FixedDatum.h
  FourByteChunk.h
  FundamentalParameterData.h
  FundamentalParameterDataIff.h
  GridAxisRecord.h
  GridAxisRecordRepresentation0.h
  GridAxisRecordRepresentation1.h
  GridAxisRecordRepresentation2.h
  GriddedDataPdu.h
  IffAtcNavAidsLayer1Pdu.h
  IffAtcNavAidsLayer2Pdu.h
  IffFundamentalData.h
  IntercomCommunicationsParameters.h
  IntercomControlPdu.h
  IntercomSignalPdu.h
  IsGroupOfPdu.h
  IsPartOfPdu.h
  LayerHeader.h
  LinearObjectStatePdu.h
  LinearSegmentParameter.h
  LogisticsFamilyPdu.h
  LogisticsPdu.h
  Marking.h
  MinefieldDataPdu.h
  MinefieldFamilyPdu.h
  MinefieldPduFamily.h
  MinefieldQueryPdu.h
  MinefieldResponseNackPdu.h
  MinefieldStatePdu.h
  ModulationType.h
  NamedLocation.h
  ObjectType.h
  Orientation.h
  PduContainer.h
  Pdu.h
  Point.h
  PointObjectStatePdu.h
  PropulsionSystemData.h
  RadioCommunicationsFamilyPdu.h
  RadioEntityType.h
  ReceiverPdu.h
  RecordQueryReliablePdu.h
  RecordSet.h
  Relationship.h
  RemoveEntityPdu.h
  RemoveEntityReliablePdu.h
  RepairCompletePdu.h
  RepairResponsePdu.h
  ResupplyCancelPdu.h
  ResupplyOfferPdu.h
  ResupplyReceivedPdu.h
  SeesPdu.h
  ServiceRequestPdu.h
  SetDataPdu.h
  SetDataReliablePdu.h
  SetRecordReliablePdu.h
  ShaftRPMs.h
  SignalPdu.h
  SimulationAddress.h
  SimulationManagementFamilyPdu.h
  SimulationManagementWithReliabilityFamilyPdu.h
  SixByteChunk.h
  SphericalHarmonicAntennaPattern.h
  StartResumePdu.h
  StartResumeReliablePdu.h
  StopFreezePdu.h
  StopFreezeReliablePdu.h
  SupplyQuantity.h
  symbolic_names.h
  SyntheticEnvironmentFamilyPdu.h
  SystemID.h
  TrackJamTarget.h
  TransferControlRequestPdu.h
  TransmitterPdu.h
  TwoByteChunk.h
  UaPdu.h
  VariableDatum.h
  Vector3Double.h
  Vector3Float.h
  VectoringNozzleSystemData.h
  WarfareFamilyPdu.h
)

# Create list of all source files
set(dis6_src
  AcknowledgePdu.cpp
  AcknowledgeReliablePdu.cpp
  AcousticBeamData.cpp
  AcousticBeamFundamentalParameter.cpp
  AcousticEmitter.cpp
  AcousticEmitterSystem.cpp
  AcousticEmitterSystemData.cpp
  ActionRequestPdu.cpp
  ActionRequestReliablePdu.cpp
  ActionResponsePdu.cpp
  ActionResponseReliablePdu.cpp
  AggregateID.cpp
  AggregateMarking.cpp
  AggregateStatePdu.cpp
  AggregateType.cpp
  AngularVelocityVector.cpp
  AntennaLocation.cpp
  ApaData.cpp
  ArealObjectStatePdu.cpp
  ArticulationParameter.cpp
  BeamAntennaPattern.cpp
  BeamData.cpp
  BurstDescriptor.cpp
  ClockTime.cpp
  CollisionElasticPdu.cpp
  CollisionPdu.cpp
  CommentPdu.cpp
  CommentReliablePdu.cpp
  CreateEntityPdu.cpp
  CreateEntityReliablePdu.cpp
  DataPdu.cpp
  DataQueryPdu.cpp
  DataQueryReliablePdu.cpp
  DataReliablePdu.cpp
  DeadReckoningParameter.cpp
  DesignatorPdu.cpp
  DetonationPdu.cpp
  DistributedEmissionsFamilyPdu.cpp
  EightByteChunk.cpp
  ElectromagneticEmissionBeamData.cpp
  ElectromagneticEmissionsPdu.cpp
  ElectromagneticEmissionSystemData.cpp
  EmitterSystem.cpp
  EntityID.cpp
  EntityInformationFamilyPdu.cpp
  EntityManagementFamilyPdu.cpp
  EntityStatePdu.cpp
  EntityStateUpdatePdu.cpp
  EntityType.cpp
  EnvironmentalProcessPdu.cpp
  Environment.cpp
  EventID.cpp
  EventReportPdu.cpp
  EventReportReliablePdu.cpp
  FastEntityStatePdu.cpp
  FirePdu.cpp
  FixedDatum.cpp
  FourByteChunk.cpp
  FundamentalParameterData.cpp
  FundamentalParameterDataIff.cpp
  GridAxisRecord.cpp
  GridAxisRecordRepresentation0.cpp
  GridAxisRecordRepresentation1.cpp
  GridAxisRecordRepresentation2.cpp
  GriddedDataPdu.cpp
  IffAtcNavAidsLayer1Pdu.cpp
  IffAtcNavAidsLayer2Pdu.cpp
  IffFundamentalData.cpp
  IntercomCommunicationsParameters.cpp
  IntercomControlPdu.cpp
  IntercomSignalPdu.cpp
  IsGroupOfPdu.cpp
  IsPartOfPdu.cpp
  LayerHeader.cpp
  LinearObjectStatePdu.cpp
  LinearSegmentParameter.cpp
  LogisticsFamilyPdu.cpp
  LogisticsPdu.cpp
  Marking.cpp
  MinefieldDataPdu.cpp
  MinefieldFamilyPdu.cpp
  MinefieldPduFamily.cpp
  MinefieldQueryPdu.cpp
  MinefieldResponseNackPdu.cpp
  MinefieldStatePdu.cpp
  ModulationType.cpp
  NamedLocation.cpp
  ObjectType.cpp
  Orientation.cpp
  PduContainer.cpp
  Pdu.cpp
  Point.cpp
  PointObjectStatePdu.cpp
  PropulsionSystemData.cpp
  RadioCommunicationsFamilyPdu.cpp
  RadioEntityType.cpp
  ReceiverPdu.cpp
  RecordQueryReliablePdu.cpp
  RecordSet.cpp
  Relationship.cpp
  RemoveEntityPdu.cpp
  RemoveEntityReliablePdu.cpp
  RepairCompletePdu.cpp
  RepairResponsePdu.cpp
  ResupplyCancelPdu.cpp
  ResupplyOfferPdu.cpp
  ResupplyReceivedPdu.cpp
  SeesPdu.cpp
  ServiceRequestPdu.cpp
  SetDataPdu.cpp
  SetDataReliablePdu.cpp
  SetRecordReliablePdu.cpp
  ShaftRPMs.cpp
  SignalPdu.cpp
  SimulationAddress.cpp
  SimulationManagementFamilyPdu.cpp
  SimulationManagementWithReliabilityFamilyPdu.cpp
  SixByteChunk.cpp
  SphericalHarmonicAntennaPattern.cpp
  StartResumePdu.cpp
  StartResumeReliablePdu.cpp
  StopFreezePdu.cpp
  StopFreezeReliablePdu.cpp
  SupplyQuantity.cpp
  SyntheticEnvironmentFamilyPdu.cpp
  SystemID.cpp
  TrackJamTarget.cpp
  TransferControlRequestPdu.cpp
  TransmitterPdu.cpp
  TwoByteChunk.cpp
  UaPdu.cpp
  VariableDatum.cpp
  Vector3Double.cpp
  Vector3Float.cpp
  VectoringNozzleSystemData.cpp
  WarfareFamilyPdu.cpp
)

# CMake < 3.16 requires target_sources to be specified as
# absolute paths if not in the same directory as the target
# definition. If cmake_minimum_required is ever changed to
# be >= 16, this line can be removed.
list(TRANSFORM dis6_src PREPEND "${CMAKE_CURRENT_LIST_DIR}/")

include(GenerateExportHeader)
generate_export_header(OpenDIS6)
list(APPEND dis6_hdr "${CMAKE_CURRENT_BINARY_DIR}/opendis6_export.h")

target_sources(OpenDIS6 PRIVATE ${dis6_src})

install(FILES ${dis6_hdr}
        DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dis6)
